package com.yilin.tms.core.entity.system.system;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yilin.tms.core.commons.base.BaseEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;

/**
 * 菜单操作表
 * 定义菜单的所有操作
 * 绑定权限时要给与对应的权限操作符号
 * 前台根据权限的操作符号显示操作按钮的显示与隐藏
 * VUE 框架支持直接在MENU层传入权限操作
 * */
@Entity
@Table(name = "sys_menu_operate")
@TableName("sys_menu_operate")
public class MenuOperate extends BaseEntity implements Serializable {

    public enum OperatePosition{
        header(0,"头部"),
        column(1,"列表行"),
        custom(2,"自定义");
        @EnumValue
        public Integer index;
        public String name;

        OperatePosition(Integer index, String name) {
            this.index = index;
            this.name = name;
        }
    }

    @Column(name = "menu_id")
    private String menuId; //所属菜单
    @Column(name = "menu_code")
    private String menuCode; //所属菜单
    @Column(name = "menu_name")
    private String menuName;

    @Column(name = "name")
    private String name;//操作名称
    @Column(name = "code")
    private String code;//操作码
    @Column(name = "icon")
    private String icon;//图标
    @Column(name = "background_color")
    private String backgroundColor;

    @Column(name = "operate_position")
    private OperatePosition operatePosition; //按钮位置
    @Column(name = "operate_condition")
    private String operateCondition;//operateCondition
    @Column(name = "operate_url")
    private String operateUrl;//操作地址
    @Column(name = "remark")
    private String remark;//说明
    @Column(name = "soft")
    private Integer soft = 0; //排序

    public String getOperateCondition() {
        return operateCondition;
    }

    public void setOperateCondition(String operateCondition) {
        this.operateCondition = operateCondition;
    }

    public String getBackgroundColor() {
        return backgroundColor;
    }

    public void setBackgroundColor(String backgroundColor) {
        this.backgroundColor = backgroundColor;
    }

    public Integer getSoft() {
        return soft;
    }

    public void setSoft(Integer soft) {
        this.soft = soft;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public String getMenuCode() {
        return menuCode;
    }

    public void setMenuCode(String menuCode) {
        this.menuCode = menuCode;
    }

    public String getOperateUrl() {
        return operateUrl;
    }

    public void setOperateUrl(String operateUrl) {
        this.operateUrl = operateUrl;
    }

    public String getMenuId() {
        return menuId;
    }

    public void setMenuId(String menuId) {
        this.menuId = menuId;
    }

    public String getMenuName() {
        return menuName;
    }

    public void setMenuName(String menuName) {
        this.menuName = menuName;
    }

    public OperatePosition getOperatePosition() {
        return operatePosition;
    }

    public void setOperatePosition(OperatePosition operatePosition) {
        this.operatePosition = operatePosition;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }
}
